<template>
	<div class="content">
		<!-- 全真模拟页 -->
		<!-- 面包屑导航 -->
		<Crumbs :item="crumbsItem" @crumbsClick="crumbsClick"></Crumbs>

		<!-- 手动组卷-选择章节页 -->
		<!-- <div class="compMock_a" v-if="show == 7">
			<span class="click_word" @click="mockShow(pageNo)">全真模拟</span>
			<span><i class="el-icon-arrow-right"></i></span>
			<span class="click_word" @click="skip(3)">在线组卷</span>
			<span><i class="el-icon-arrow-right"></i></span>
			<span class="click_word" @click="skip(6)">手动组卷</span>
			<span><i class="el-icon-arrow-right"></i></span>
			<span class="a_this">选择章节</span>
		</div> -->
		<div class="content">
			<div class="tabs" v-if="show == 1 || show == 2">
				<div :class="{ active: show == 1 }" @click="show = 1">模拟考试</div>
				<div :class="{ active: show == 2 }" @click="show = 2">在线组卷</div>
			</div>
			<!-- 模拟考试列表 -->
			<paperItem :list="mockExam" :modeFlase="modeFlase" v-if="show == 1" @paperClick="skipResult" @startAnswer="clickStart"></paperItem>
			<!-- Question题目列表     CountVO答题卡数据  isRecitation是否背题模式  isCorrecting 是否批改题目-->
			<answer
				ref="answer"
				v-if="show == 11"
				@sumitSucess="sumitSucess"
				:CorrectCount="correctCount"
				:ErrorCount="errorCount"
				:Question="Question"
				:CountVO="CountVO"
				:isRecitation="isRecitation"
				:isCorrecting="isCorrecting"
				:Paper="Paper"
				:isCountDown="isCountDown"
				:Formalexam="Formalexam"
				:topicNumber="Paper.number"
				updateHis="updateExamHistory"
			></answer>

			<!-- 成绩页面 -->
			<!-- clickStart 再考一次事件  viewWrong查看错题事件 -->
			<ScoreModule v-if="show == 8" :data="transcript" @againBtn="clickStart" @viewWrong="viewWrong"></ScoreModule>

			<!-- 在线组卷 -->
			<div id="b_b" :class="{ hide: show != 2, show: show == 2 }">
				<h3>组卷类型</h3>
				<ul id="b_b_menu">
					<li id="b_b_a" @click="skip(5)">
						<h2>一键组卷</h2>
						<h5>自主组卷、只需一键</h5>
					</li>
					<li id="b_b_b" @click="skip(6)">
						<h2>手动组卷</h2>
						<h5>章节、题目自由设置</h5>
					</li>
				</ul>
				<div class="clear"></div>
				<h3>
					<div />
					试卷列表
					<span @click="show = 3">
						更多
						<img src="../../assets/more.png" />
					</span>
				</h3>
			</div>
			<!-- 试卷列表 -->
			<paperItem :list="onlineExam" :modeFlase="modeFlase" difTime="createtime" v-if="show == 2" @paperClick="skipResult" @changeAnswer="changeAnswer" @startAnswer="clickStart"></paperItem>

			<div id="e" v-if="show == 3 || show == 4">
				<div :class="{ active: show == 3 }" @click="show = 3">未考试卷</div>
				<div :class="{ active: show == 4 }" @click="show = 4">已考试卷</div>
			</div>
			<!-- 3、未考试卷  4、已考试卷 -->
			<paperItem :list="onlineExam" :modeFlase="modeFlase" difTime="createtime" v-if="show == 3 || show == 4" @paperClick="skipResult" @changeAnswer="changeAnswer" @startAnswer="clickStart"></paperItem>
			<PgCom
				v-if="(show == 1 && total > pageSize) || (show == 3 && total > pageSize) || (show == 4 && total > pageSize)"
				:total="total"
				:pageSize="pageSize"
				:pageNo="pageNo"
				@pageNoChange="pageNoChange"
			></PgCom>
		</div>
		<!-- 一键组卷 -->
		<div id="yijian" v-if="show == 5">
			<h1>请选择您的组卷科目</h1>
			<h3>模拟真实考试，自动生成正式考卷</h3>
			<ul>
				<li @click="check(1)" :class="[yijianA ? 'check' : '', 'a']">
					<i class="iconfont icon-kemu1"></i>
					<h2>科目一、科目二</h2>
					<h5>政策与法律法规 | 导游业务</h5>
				</li>
				<li @click="check(2)" :class="[yijianB ? 'check' : '', 'b']">
					<i class="iconfont icon-kemu4"></i>
					<h2>科目三、科目四</h2>
					<h5>全国导游基础知识 | 地方导游基础知识</h5>
				</li>
			</ul>
			<div class="tips_words">
				<div class="tips_words_a">温馨提示：</div>
				<p>① 科目一、二合并为1张试卷进行考试，科目三、四合并为1张试卷进行考试。</p>
				<p>② 每张试卷考试时间为90分钟，含165题，共100分。</p>
				<p>③ 考试题型包括判断题、单选题、多选题。其中判断题40题，每题0.5分，共20分；单选题90分，每题0.5分，共45分；多选题35题，每题1分，共35分。</p>
			</div>
			<div class="btn" @click="groupPaper">一键组卷</div>
		</div>
		<!-- 手动组卷 -->
		<div id="shoudong" :class="{ hide: show != 6, show: show == 6 }">
			<h1>请选择您的组卷科目</h1>
			<h3>允许跨科目选择不同的章节进行组卷</h3>
			<ul v-if="shoudongArr">
				<li @click="check(3)" :class="[shoudongArr[0] ? 'check' : '', 'a']">
					<i class="iconfont icon-kemu1"></i>
					<div>
						<h2>科目一 政策与法律法规</h2>
						<h5 v-if="shoudongArr[0]">{{ subChapter[0].chapterWords }}</h5>
					</div>
				</li>
				<li @click="check(4)" :class="[shoudongArr[1] ? 'check' : '', 'b']">
					<i class="iconfont icon-kemu2"></i>
					<div>
						<h2>科目二 导游业务</h2>
						<h5 v-if="shoudongArr[1]">{{ subChapter[1].chapterWords }}</h5>
					</div>
				</li>
			</ul>
			<ul v-if="shoudongArr">
				<li @click="check(5)" :class="[shoudongArr[2] ? 'check' : '', 'c']">
					<i class="iconfont icon-kemu3"></i>
					<div>
						<h2>科目三 全国导游基础知识</h2>
						<h5 v-if="shoudongArr[2]">{{ subChapter[2].chapterWords }}</h5>
					</div>
				</li>
				<li @click="check(6)" :class="[shoudongArr[3] ? 'check' : '', 'd']">
					<i class="iconfont icon-kemu4"></i>
					<div>
						<h2>科目四 地方导游基础知识</h2>
						<h5 v-if="shoudongArr[3]">{{ subChapter[3].chapterWords }}</h5>
					</div>
				</li>
			</ul>
			<div class="btn" @click="setups">设置题型</div>
		</div>
		<!-- 选择章节 -->
		<div id="xuanze" v-if="show == 7">
			<ul class="kemu_ul">
				<li v-for="(item, index) in subChapter" :key="index">
					<h1 @click="openKemu(index)">
						<div @click.stop="checkSub(index)" :class="item.checkCode != 0 ? 'check' : ''">
							<i v-if="item.checkCode == 2" class="iconfont icon-_datixuanxiang" style="color: #ffffff;font-size: 12px"></i>
							<i v-if="item.checkCode == 1" class="iconfont icon-fuxuankuang_banxuan" style="color: #ffffff;font-size: 12px"></i>
						</div>
						<span>{{ item.subname }}</span>
						<i :class="['iconfont', 'jiantou', kOpens[index].kOpen ? 'icon-jiantou_zhangjiexuanze' : 'icon-jiantou_zhangjiexuanze-copy']" style="color: #394151;font-size: 20px" />
					</h1>
					<ul class="chapter_ul" v-if="kOpens[index].kOpen">
						<li v-for="(citem, cindex) in item.chapterList" :key="cindex">
							<h1>
								<div @click="checkChapter(index, cindex)" :class="citem.checkCode != 0 ? 'check' : ''">
									<i v-if="citem.checkCode == 2" class="iconfont icon-_datixuanxiang" style="color: #ffffff;font-size: 12px"></i>
								</div>
								<span>{{ citem.chaptername }}</span>
							</h1>
						</li>
					</ul>
				</li>
			</ul>
			<div class="btn" @click="confirmChapter">确定</div>
		</div>
		<!-- 设置题型弹框 -->
		<el-dialog title="设置题型" :visible.sync="dialogFormVisible" width="712px" :append-to-body="true">
			<el-form :model="form" :rules="rules" ref="form">
				<el-form-item label="单选题" :label-width="formLabelWidth">
					<el-input v-model="form.singleChoice" type="number" autocomplete="off" :placeholder="holder(1)"></el-input>
				</el-form-item>
				<el-form-item label="多选题" :label-width="formLabelWidth">
					<el-input v-model="form.multipleChoice" type="number" autocomplete="off" :placeholder="holder(2)"></el-input>
				</el-form-item>
				<el-form-item label="判断题" :label-width="formLabelWidth">
					<el-input v-model="form.trueFalse" type="number" autocomplete="off" :placeholder="holder(3)"></el-input>
				</el-form-item>
				<el-form-item label="时间设置" :label-width="formLabelWidth" prop="times">
					<el-input v-model="form.times" type="number" autocomplete="off" placeholder="输入正整数">
						<i slot="suffix" style="font-style:normal;margin-right: 10px;">分钟</i>
					</el-input>
				</el-form-item>
				<el-form-item label="试卷名称" :label-width="formLabelWidth" prop="papername">
					<el-input v-model="form.papername" autocomplete="off" placeholder="输入试卷名称"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="shoudong('form')">确 定</el-button>
			</div>
		</el-dialog>
		<Empty v-if="(show == 3 && onlineExam.length == 0) || (show == 4 && onlineExam.length == 0)" text="暂无考试"></Empty>
	</div>
</template>

<script>
import exam from '../../../mixins/exam.js';
export default {
	name: 'CompleteMock',
	components: {},
	mixins: [exam],
	data() {
		return {
			crumbsItem: [{ name: '全真模拟', url: 1 }], //面包屑导航
			pageNo: 1,
			pageSize: 6,
			total: 0,
			dialogFormVisible: false,
			transcript: {}, //成绩页面
			form: {
				singleChoice: '',
				multipleChoice: '',
				trueFalse: '',
				times: '',
				papername: '',
				delivery: false,
				type: [],
				resource: '',
				desc: ''
			},
			rules: {
				times: [{ required: true, message: '请输入时间', trigger: 'blur' }],
				papername: [{ required: true, message: '请输入试卷名称', trigger: 'blur' }]
			},
			formLabelWidth: '120px',
			kOpens: [{ kOpen: false }, { kOpen: false }, { kOpen: false }, { kOpen: false }], //按顺序科一到科四
			subChapter: [], //章节数组
			yijianA: false,
			yijianB: false,
			shoudongArr: [false, false, false, false], //科一到科四
			show: 1, //1是模拟考试 2在线组卷 3未考试卷 4已考试卷 5 一键组卷 6 手动组卷 7手动组卷选择章节  8成绩页  11答题页
			mockExamPages: null,
			mockExam: [],
			onlineExam: [],
			chapterId: '',
			singleChoiceCount: 0,
			multipleChoiceCount: 0,
			trueFalseCount: 0,
			CountVO: {}, //题卡
			Question: [], //题目
			correctCount: 0, //正确数量
			errorCount: 0, //错误数量
			Paper: {}, //传递试卷信息
			Formalexam: false, //正式考试
			isRecitation: false, //是否背题模式
			isCorrecting: false, //是否批改题目
			isCountDown: false, //是否倒计时   模拟正计时 组卷倒计时
			modeFlase:false,//开始提示弹窗
		};
	},
	created() {
		this.mockShow(this.pageNo);
	},
	watch: {
		show() {
			this.pageNo = 1;
			setTimeout(()=>{
				if (this.show == 1) {
					this.mockShow();
				} else if (this.show == 3) {
					this.willPaper();
				} else if (this.show == 4) {
					this.finalPaper();
				} else if (this.show == 2) {
					this.onlineSimpleShow();
				} else if (this.show == 6){
					this.crumbsItem = [{ name: '全真模拟', url: 1 }, { name: '在线组卷', url: 2 } , { name: '手动组卷', url: 6 }];
				}
			},500)
		}
	},
	mounted() {
		window.addEventListener('beforeunload', e => {
			if (this.refresh.clickDis) {
				this.beforeunloadHandler(e);
			}
		});
	},
	destroyed() {
		window.addEventListener('beforeunload', e => {
			if (this.refresh.clickDis) {
				this.beforeunloadHandler(e);
			}
		});
	},
	methods: {
		beforeunloadHandler(e) {
			e = e || window.event;
			if (this.show == 11) {
				if (e) {
					e.returnValue = '正在更新数据';
				}
				this.$refs.answer.updateHistoryHander('updateExamHistory');
				return;
			}
		},
		crumbsClick(type) {
			//导航切换事件
			if(this.show != 6){
				//只有跳到其他页面才清空选择
				this.getSubAndChapter();
				this.shoudongArr = [false, false, false, false]
			}
			this.kOpens = [{ kOpen: false }, { kOpen: false }, { kOpen: false }, { kOpen: false }]
			this.show = type;
			// this.$refs.answer.updateHistoryHander('updateExamHistory','地方阿斯蒂芬阿斯蒂芬')
			this.leaveStatus = true; //自动更新答题记录
			this.pageNo = 1;
			if (type == 1 || type == 2) {
				this.crumbsInit();
			} else if (type == 3 || type == 4) {
				this.crumbsItem = [{ name: '全真模拟', url: 1 }, { name: '在线组卷', url: 2 }];
			}
		},
		crumbsInit() {
			// 导航默认
			this.crumbsItem = [{ name: '全真模拟', url: 1 }];
		},
		sumitSucess(e) {
			//交卷成功
			this.show = 8;
			this.Paper.status = 2;
			this.Paper.upid = e;
			this.skipResult(this.Paper);
		},
		setCrumbs(name, url) {
			// this.crumbsInit();
			// let navLi = {
			// 	name: name,
			// 	url: url
			// };
			// this.crumbsItem.push(navLi);
			let navLi = [];
			if (this.show == 1) {
				navLi = [{ name: '模拟考试', url: 1 }, { name: name, url: url }];
			} else if (this.show == 2) {
				navLi = [{ name: '在线组卷', url: 2 }, { name: name, url: url }];
			} else if (this.show == 3) {
				navLi = [{ name: '未考试卷', url: 3 }, { name: name, url: url }];
			} else if (this.show == 4) {
				navLi = [{ name: '已考试卷', url: 4 }, { name: name, url: url }];
			}
			this.crumbsItem = this.crumbsItem.concat(navLi);
		},
		// 成绩页面跳转
		skipResult(e) {
			this.Paper = e; //试卷信息带给答题页
			let val1 = e.upid,
				val2 = e.papername,
				val3 = e.status;
			if (val3 === 2) {
				this.setCrumbs(val2, 8);
				this.show = 8;
				this.axios
					.get('/web/student/home/getTranscript', {
						params: {
							upid: val1
						}
					})
					.then(res => {
						this.transcript = res;
						this.correctCount = this.transcript.rightsquescou;
						this.errorCount = this.transcript.errorsquescou;
					});
			}
		},
		checkSub(val) {
			this.subChapter[val].checkCode = this.subChapter[val].checkCode == 1 ? 2 : Math.abs(this.subChapter[val].checkCode - 2);
			var ccode = this.subChapter[val].checkCode;
			this.subChapter[val].chapterList.forEach(function(item) {
				item.checkCode = ccode;
			});
		},
		checkChapter(v1, v2) {
			this.subChapter[v1].chapterList[v2].checkCode = Math.abs(this.subChapter[v1].chapterList[v2].checkCode - 2);
			var cou = 0;
			this.subChapter[v1].chapterList.forEach(function(item) {
				if (item.checkCode == 2) {
					cou++;
				}
			});
			if (cou == 0) {
				this.subChapter[v1].checkCode = 0;
			} else if (cou > 0 && cou < this.subChapter[v1].chapterList.length) {
				this.subChapter[v1].checkCode = 1;
			} else {
				this.subChapter[v1].checkCode = 2;
			}
		},
		openKemu(val) {
			this.kOpens[val].kOpen = !this.kOpens[val].kOpen;
		},
		skip(val) {
			this.crumbsInit();
			if (val == 5 || val == 6) {
				let navLi1 = {
					name: '在线组卷',
					url: 2
				};
				this.crumbsItem.push(navLi1);
				let navLi = {
					name: val == 5 ? '一键组卷' : '手动组卷',
					url: val
				};
				this.show = val;
				this.crumbsItem.push(navLi);
				this.getSubAndChapter();
			}
		},
		pageNoChange(val) {
			this.pageNo = val;
			if (this.show == 1) {
				this.mockShow();
			} else if (this.show == 3) {
				this.willPaper();
			} else if (this.show == 4) {
				this.finalPaper();
			}
		},
		//获取模拟考试列表
		mockShow() {
			// this.onlineExam = [];
			this.show = 1;
			this.isCountDown = false;
			this.axios
				.post('/web/student/home/getPropositionList', {
					pageNo: this.pageNo,
					pageSize: this.pageSize,
					papertype: 3
				})
				.then(res => {
					this.mockExam = res.list;
					// this.mockExamPages = res.pages;
					this.total = res.total;
				});
			this.getSubAndChapter();
		},
		//获取在线考试首页
		onlineSimpleShow() {
			// this.onlineExam = [];
			this.show = 2;
			this.isCountDown = true;
			this.axios
				.post('/web/student/home/homePaper', {
					// "pageNo": this.pageNo,
					// "pageSize": 2,
					papertype: 4
				})
				.then(res => {
					this.onlineExam = res;
				});
		},
		//获取未完成试卷
		willPaper() {
			// this.onlineExam = [];
			this.crumbsInit();
			let navLi = {
				name: '在线组卷',
				url: 2
			};
			this.crumbsItem.push(navLi);
			this.show = 3;
			this.axios
				.post('/web/student/home/groupPaperList', {
					pageNo: this.pageNo,
					pageSize: this.pageSize,
					papertype: 4,
					type: 3
				})
				.then(res => {
					this.onlineExam = res.list;
					// this.mockExamPages = res.pages;
					this.total = res.total;
				});
		},
		//获取已完成试卷列表
		finalPaper() {
			// this.onlineExam = []
			this.show = 4;
			this.axios
				.post('/web/student/home/groupPaperList', {
					pageNo: this.pageNo,
					pageSize: this.pageSize,
					papertype: 4,
					type: 2
				})
				.then(res => {
					this.onlineExam = res.list;
					// this.mockExamPages = res.pages;
					this.total = res.total;
				});
		},
		// 手动组卷
		check(val) {
			let num = parseInt(val - 3);
			// 判断面包屑
			let curIndex = this.crumbsItem.length - 1;
			let navLi = {
				name: '选择章节',
				url: 7
			};
			switch (val) {
				case 1:
					this.yijianA = !this.yijianA;
					this.yijianB = false;
					break;
				case 2:
					this.yijianB = !this.yijianB;
					this.yijianA = false;
					break;
				default:
					//手动科一到科四
					this.shoudongArr[num] = !this.shoudongArr[num];
					if (this.crumbsItem[curIndex].name != '选择章节') {
						this.crumbsItem.push(navLi);
					}
					this.show = 7;
					this.kOpens[num].kOpen = true
					break;
			}
		},
		//获取科目章节
		getSubAndChapter() {
			this.shoudongArr=[false, false, false, false]
			this.axios.get('/web/student/home/getSubAndChapterList').then(res => {
				let arr = [];
				res.map(item => {
					arr.push(Object.assign({}, item, { chapterWords: '' }));
				});
				this.subChapter = arr;
				// console.log(JSON.stringify(this.subChapter));
			});
		},
		confirmChapter() {
			let count = 0;
			let chapterid = '';
			for (let i = 0; i < 4; i++) {
				if (this.subChapter[i].checkCode > 0) {
					count++;
				}
				this.shoudongArr[i] = this.subChapter[i].checkCode > 0;
				if (this.shoudongArr[i]) {
					if (this.subChapter[i].checkCode == 2) {
						this.subChapter[i].chapterWords = '全部章节';
					} else {
						var words = '';
						this.subChapter[i].chapterList.forEach(function(item) {
							if (item.checkCode == 2) {
								words += ';' + item.chaptername;
							}
						});
						words = words.substring(1, 17);
						if (words.length == 16) words = words + '...';
						this.subChapter[i].chapterWords = words;
					}
				}
				if (this.subChapter[i].checkCode > 0) {
					this.subChapter[i].chapterList.forEach(function(item) {
						if (item.checkCode === 2) {
							chapterid += item.chapterid + ',';
						}
					});
				}
			}
			let reg = /,$/gi;
			chapterid = chapterid.replace(reg, '');
			this.chapterId = chapterid;
			if (count > 2) {
				this.$notify({
					title: '',
					message: '所选科目最多只能选两个科目的章节',
					type: 'warning'
				});
			} else {
				this.show = 6;
			}
		},
		//一键组卷
		groupPaper() {
			if (this.yijianA != false || this.yijianB != false) {
				let subId = 1;
				if (this.yijianA === true) subId = 1;
				if (this.yijianB === true) subId = 2;
				this.axios
					.post('/web/student/home/groupPaper', {
						groupType: 1,
						subId: subId
					})
					.then(res => {
						this.yijianA = false;
						this.yijianB = false;
						this.show = 2;
						this.onlineSimpleShow();
						console.log('返回的总结果是：' + res);
						this.$notify({
							title: '组卷成功',
							message: '快去做题吧',
							type: 'success'
						});
					})
					.catch(err => {
						console.log(err);
					});
			} else {
				this.$notify({
					title: '',
					message: '请选择一个科目',
					type: 'warning'
				});
			}
		},
		setups() {
			let a = this.shoudongArr.filter(function(n) {
				return n === true;
			});
			if (a.length > 0) {
				this.dialogFormVisible = true;
				this.axios.get('/web/student/home/getQueCountByChapterId/' + this.chapterId).then(res => {
					this.singleChoiceCount = res.singleChoiceCount;
					this.multipleChoiceCount = res.multipleChoiceCount;
					this.trueFalseCount = res.trueFalseCount;
				});
			} else {
				this.$notify({
					title: '',
					message: '请至少选择一个科目的章节',
					type: 'warning'
				});
			}
		},
		holder(val) {
			if (val === 1) {
				return '最多可选' + this.singleChoiceCount + '道题';
			} else if (val === 2) {
				return '最多可选' + this.multipleChoiceCount + '道题';
			} else if (val === 3) {
				return '最多可选' + this.trueFalseCount + '道题';
			}
		},
		//手动组卷
		shoudong(form) {
			let subids = '';
			for (let i = 0; i < this.shoudongArr.length; i++) {
				if (this.shoudongArr[i] === true) {
					if (i === 0) {
						subids += '1,';
					}
					if (i === 1) {
						subids += '2,';
					}
					if (i === 2) {
						subids += '9,';
					}
					if (i === 3) {
						subids += '10,';
					}
				}
			}
			let reg = /,$/gi;
			subids = subids.replace(reg, '');
			this.$refs[form].validate(valid => {
				if (valid) {
					this.axios
						.post('/web/student/home/groupPaper', {
							groupType: 2,
							chapterId: this.chapterId,
							minutes: this.form.times,
							multipleChoiceCount: (this.form.multipleChoice = this.form.multipleChoice == '' ? 0 : this.form.multipleChoice),
							paperName: this.form.papername,
							singleChoiceCount: (this.form.singleChoice = this.form.singleChoice == '' ? 0 : this.form.singleChoice),
							trueFalseCount: (this.form.trueFalse = this.form.trueFalse == '' ? 0 : this.form.trueFalse),
							subId: subids
						})
						.then(res => {
							this.form.multipleChoice = ''
							this.form.singleChoice = ''
							this.form.trueFalse = ''
							this.shoudongArr = [false, false, false, false];
							this.dialogFormVisible = false;
							// alert("组卷成功")
							this.show = 2;
							this.onlineSimpleShow();
							this.crumbsInit();
							this.$notify({
								title: '组卷成功',
								message: '快去做题吧',
								type: 'success'
							});
							this.$refs[form].resetFields()
							console.log(res);
						});
					// .catch(err => {
					// 	// console.log(err);
					// 	this.$notify.error({
					// 		title: '组卷失败',
					// 		message: err
					// 	});
					// });
				} else {
					return false;
				}
			});
		},
		clickStart(e) {
			// if(e.duration==undefined) return;
			if (e.restart) {
				//再考一次进入
				this.Paper.minutes = e.duration;
				this.Paper.duration = 0;
			}
			this.Paper.number = 1;
			const pageData = {
				paperid: e.paperid,
				upid: e.upid
			};
			this.modeFlase=true
			this.setCrumbs(e.papername, 11);
			this.Formalexam = true;
			this.isRecitation = false; //不是背题模式
			this.isCorrecting = false;
			// 开始答题
			this.startAnswer(pageData);
		},
		viewWrong(e) {
			const pageData = {
				paperid: this.Paper.paperid,
				upid: this.Paper.upid,
				isCorrect: e
			};
			this.Paper.number = 1;
			// 查看错题
			this.Formalexam = false;
			this.isRecitation = true;
			this.isCorrecting = true;
			this.viewWrongTopic(pageData);
		}
	}
};
</script>
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
}
.inputNb[type="number"]{
  -moz-appearance: textfield;
}
</style>
<style scoped src="../../style/compmock/completeMock.css" />
